package com.ces.knacky.model;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.ces.knacky.framework.model.AbstractChildEntity;

/** @author Hibernate CodeGenerator */
@XmlRootElement
public class OrderItem extends AbstractChildEntity implements Serializable {

	/** persistent field */
    private com.ces.knacky.model.OrderTable order;

    /** persistent field */
    private int quantity;

    /** persistent field */
    private com.ces.knacky.model.Item item;

    /** full constructor */
    public OrderItem(int quantity, com.ces.knacky.model.OrderTable order, com.ces.knacky.model.Flag flag, com.ces.knacky.model.Item item) {
        this.quantity = quantity;
        this.order = order;
        this.flag = flag;
        this.item = item;
    }

    /** default constructor */
    public OrderItem() {
    }


    public int getQuantity() {
        return this.quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public com.ces.knacky.model.OrderTable getOrder() {
        return this.order;
    }

    public void setOrder(com.ces.knacky.model.OrderTable order) {
        this.order = order;
    }

    public com.ces.knacky.model.Flag getFlag() {
        return this.flag;
    }

    public void setFlag(com.ces.knacky.model.Flag flag) {
        this.flag = flag;
    }

    
    public com.ces.knacky.model.Item getItem() {
        return this.item;
    }

    public void setItem(com.ces.knacky.model.Item item) {
        this.item = item;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof OrderItem) ) return false;
        OrderItem castOther = (OrderItem) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }

}
